PushNotifications-SOAP

PushNotifications attached business rule can be configured to send downstream messages when an activity processing is completed and before committing the persisted data to DB. These messages are delivered to the downstream for the events defined in the DownstreamMessagePushDefinition rule through SOAP. The rule can be overridden at Activity Plan, Activity Policy, Activity Client, Activity Company and is applicable for all activity types.

Note: The rule should not be listed in the TransactionBusinessRules packet, but will get processed after post assignment and data persist.

The PushNotifications ABR allows the user to define messages for "Successful Activity Processing or when the Activity Processing Fails (OnTransactionFailure)" and send the appropriate messages to the downstream. The rule can be configured to create a business error on activity, to rollback an activity in case of message push failure or to continue processing an activity.

PushNotifications uses custom-built expressions to construct the required messages. Message templates can be created using custom configuration.

Note: Math required for PushNotifications to construct JSTL messages should be defined in Transaction XML. Date generation and date format conversion can be done by configuring a MathVariable. MessageGuid for PushNotifications will be generated by a MathVariable type. Refer to the examples mentioned in the below sections.

Events

A user can configure messages for multiple events and map each event that has one or more messages to different downstream applications. When multiple messages are defined for an event, system validates a condition, and sends appropriate message to the downstream.

<PushNotifications> may include multiple <PushNotification> for each event, which can be triggered for a particular EVENTNAME that is defined as <Event> in DownstreamMessagePushDefinition rule.

Transactions

PushNotifications can be configured to push messages for all activity types of all entities such as Plan, Policy (Policy document, Policy financial etc.), Client, Company and Customer.

<OnPushFailure>: Defines an action that needs to be taken in case of Push failure. It can be configured to,

  • define an action to be taken in case of exceptions during message push such as, call to the external system fails or timeout. An activity can be rolled back in case of push failure.
  • display business errors and warnings in case of push failure.
  • generate errors and warnings for an activity, when <RollBack> is 'Yes' and <CreateBusinessError> is 'Yes' .
  • generate errors and warnings for an activity, when <RollBack> is 'No' and <CreateBusinessError> is 'Yes' .

<OnTransactionFailure>:Creates an error message or an indication that should be pushed to downstream when an activity processing fails.

  • If PushNotifications ABR has error configuration for OnTransactionFailure, then an error message is sent to downstream in case of activity failure. If PushNotification event doesn't have OnTransactionFailure message configured, no message is sent to downstream if activity fails.
  • Multiple OnTransactionFailure messages for each event can be defined in OnTransactionFailure message section of PushNotifications. Each event can have a single OnTransactionFailure message. OnTransactionFailure message is sent to all the events defined in PushNotifications.

Note: configuring a message using <OnTransactioFailure> is optional.

Activity XML: Activity XML of PushNotifications captures the status and reason for failure of an activity processing.

Request and Response for PushNotifications

Request format Responses
  • Message
  • Header
  • Configuration (OnTransactionFailure) to send an error message if the transaction failure
  • Configuration (OnPushFailure) to handle if call to the external system fails or timeout
  • Configuration to create business error on activity
  • Response codes can be success or fail based on processing status of the service call.
  • When SOAP protocol is used to send messages, on receiving 'Success' acknowledgment data is committed to DB or commit DB transaction is processed in OIPA.
  • Failure to make a call for adding a message to queue is considered as failure.
PushNotifications - SOAP Elements and Attributes
Element/Tag Parent Element Definition Attribute Element/Attribute Value and Description
<PushNotifications>   Opening tag of PushNotifications Business rule.    
<Templates> <PushNotifications> Parent tag for templates    
<Template> <Templates> Optional: Sets parent tag for Template. Messages that are reused can be defined as template    
  <Template>   ID Contains the name of the message
<Parameters> <PushNotifications> Parent tag for parameters    
<Parameter> <Parameters> Required: Parameter mapped to math and passed to JSTL message element    
  <Parameter>   NAME Required: Name of the parameter
<JSTLMessage> <PushNotifications>     Required: JSLT tags to create message
<[parameter name]>       Used to pass the value of the parameter.
<PushNotification> <PushNotifications> Required and repeatable: Parent tag to contain all the events and their respective messages.    
  <PushNotification>   EVENT Name of the event
<Tests> <PushNotification> Parent tag for test    
<Test> <Tests> Specifies a test expression. Expression is validated and if it is true the message under the test tag will be pushed.    
  <Test> Expression for test condition    
<Template> <Test> Optional: Reusable template can be combined with message to be sent downstream    
<Message> <Test> Required: Parent tag for the message    
  <Message>   ID Name of the message
<Parameters> <Message> Parent tag for parameters    
<Parameter> <Parameters> Required: Parameter mapped to math and passed to JSTL message element    
  <Parameter>   NAME Required: Name of the parameter
<JSTLMessage> <Message> Required: JSLT tags to create message    
<OnTransactionFailure> <PushNotifications> Optional: Parent tag to define transaction failure actions and messages    
<Message> <OnTransactionFailure> Optional: Parent tag for message on transaction failure    
<Parameters> <OnTransactionFailure> Parent tag for parameters    
<Parameter> <Parameters> Required: Parameter mapped to math and passed to JSTL message element.    
  <Parameters>   NAME Required: Name of the parameter
<JSTLMessage> <Message>     Required. JSLT tags to create message
<OnPushFailure> <PushNotifications> Required: Parent tag for push failure actions    
<RollBack> <OnPushFailure>

Required:  Values - Yes/No

Yes: indicates a rollback is required.

No: indicates rollback is not needed.

 

 

<CreateBusinessError> <OnPushFailure>

Required: Values - Yes/No

Yes: indicates a business error needs to be created on activity

No: indicates business error is not needed

 

 

XML Schema

<PushNotifications>
  <Templates>
       <Template ID="[name]">
       <Parameters>
        <Parameter NAME="[name]">[field | variable]</Parameter>
        <Parameter>...</Parameter>
       </Parameters>
       <JSTLMessage>
        <[parameter name]>[parameter attribute name | literal]</[parameter name]>
        <[parameter name]>...</[parameter name]>
     </JSTLMessage>
     </Template>
     <Template>
      ...
     </Template>
  </Templates>
  <PushNotification EVENTNAME="[name]">
        <Message ID="">     
          <Tests>
            <Test>[condition]</Test>
            <Test>...</Test>
          </Tests>
           <AsEventMessage xmlns="[name space]">
              <JSTLTemplate>[id]</JSTLTemplate>
              <JSTLTemplate>...</JSTLTemplate>
              <JSTLMessage>
                 <Parameters>
                    <Parameter NAME="[name]" DATATYPE="[TEXT | INTEGER | DECIMAL | DATE | BOOLEAN | CURRENCY | BIGTEXT]" >[]</Parameter>
                     <Parameter>...</Parameter>
                 </Parameters>
                 <[parameter name]>[parameter attribute name | literal]</[parameter name]>
                 <[parameter name]>...</[parameter name]>
              </JSTLMessage>
           </AsEventMessage>
          </Message>
 <OnTransactionFailure>[failure message id]</OnTransactionFailure>          
</PushNotification>
<OnTransactionFailure>
     <Message ID="[failure message id]">
         <AsEventMessage xmlns="[name space]">
              <JSTLTemplate>[id]</JSTLTemplate>
              <JSTLTemplate>...</JSTLTemplate>
              <JSTLMessage>
                 <Parameters>
                     <Parameter NAME="[name]" DATATYPE="[TEXT | INTEGER | DECIMAL | DATE | BOOLEAN | CURRENCY | BIGTEXT]" >[]</Parameter>
                     <Parameter>...</Parameter>
                 </Parameters>
                 <[parameter name]>[parameter attribute name | literal]</[parameter name]>
                 <[parameter name]>...</[parameter name]>
              </JSTLMessage>
           </AsEventMessage>
     </Message>
     <Message>
       ...
     </Message>
 </OnTransactionFailure>
 <OnPushFailure>
       <RollbackTransaction>[Yes | No]</RollbackTransaction>
       <CreateBusinessError>[Yes | No]</CreateBusinessError
 </OnPushFailure>
</PushNotifications>

XML Example 1

<PushNotifications>
   <Templates>
      <Template id='Header'>
           <Parameters>
              <!-- MessageGuid and MessageDateTime will be auto generated -->
              <Parameter NAME= MsgGuid>Activity:MsgGUID</Parameter>
              <Parameter NAME= EFFdate>Activity:Effectivedate</Parameter>
              <Parameter NAME= ActGuid>Activity:ActivityGuid</Parameter>
              <Parameter NAME= Datetime>Activity:ActivityDateTime</Parameter>
              <Parameter NAME= Reverse>Activity:Reverse</Parameter>
          </Parameters>
          <JSTLMessage>
              <MsgGuid>[MsgGuid]</MsgGuid>
              <EffectiveDate>[EFFdate]</EffectiveDate>
              <ActivityDateTime>[Datetime]<ActivityDateTime>
              <ActivityGuid>[ActGuid] </ActivityGuid>
              <Reverse>[Reverse]</Reverse>
           </JSTLMessage>
       </Template>
    </Templates>
    <PushNotification EventName='Billing'>
       <Tests>
         <Test CONDITION=ListBill='True'>
            <Template> Header</Template>
            <Message ID='BillingMsg1'>
              <Parameters>
                  <Parameter NAME= MsgGuid>Activity:MsgGuid </Parameter>
                  <Parameter NAME= TransactionName>TransactionName </Parameter>
                  <Parameter NAME= Segment>Segment</Parameter>
                  <Parameter NAME= TransactionCount>TransactionCount </Parameter>
                  <Parameter NAME= Event>Activity:Event</Parameter>
              </Parameters>
              <JSTLMessage>
                   <Event>[Event]</Event>
                   <MSGGUId>[MsgGuid]</MSGGUId>
                   <!-- A transaction Map with Segment Object Array -->
                   <forEach items="[transactionMap]" var="eachTransaction">   
                   <Transaction name="[eachTransaction.key]">
                   <forEach items="[ eachTransaction.value]" var="eachSegment">
                       <Segment name="[eachSegment.name]">
                           <BillingTotal>[eachSegment.total]</BillingTotal>
                       </Segment>
                   </Transaction>
                   </forEach>
               </JSTLMessage>
             </Message>
           </Test>
         </Tests>
   </PushNotification>
   <OnTransactionFailure>
      <Message>
          <Parameters>
              <Parameter NAME= MsgGuid>Activity:MsgGUID</Parameter>
              <Parameter NAME= EFFdate>Activity:ActivityEffectivedate</Parameter>
              <Parameter NAME= PaidToDate>Activity:PaidToDate</Parameter>
              <Parameter NAME= Fee>Activity:PolicyFee</Parameter>
          </Parameters>
          <JSTLMessage>
               <MsgGuid>[MsgGuid]</MsgGuid>
               <EffectiveDate>[EFFdate]</EffectiveDate>
               <ActivityDateTime>[Datetime]<ActivityDateTime>
               <DueDate>[PaidToDate] </DueDate>
               <PolicyFee>[Fee]</PolicyFee>
          </JSTLMessage>
       </Message>
   </OnTransactionFailure>
   <OnPushFailure>
       <RollbackTransaction>Yes</RollbackTransaction>
       <CreateBusinessError>Yes</CreateBusinessError>
   </OnPushFailure>
</PushNotifications>

Output Example

<MsgGuid> 9B5AA155-4F7B-46AC-9A92-A253BE14C6B7</MsgGuid>
<EffectiveDate> 2016-11-01</EffectiveDate>
<ActivityDateTime>2018-07-18T09:32:12.643-05:00 <ActivityDateTime>
<ActivityGuid> AB4016A2-573D-4918-A94D-1F786725B717 </ActivityGuid>
<Event>Billing</Event>
<MsgId>BillingMsg1</MsgId>
<Transaction name="Transaction2">
<Segment name="Segment21">
<BillingTotal>111</BillingTotal>
</Segment>
<Segment name="Segment22">
<BillingTotal>222</BillingTotal>
</Segment>
</Transaction>
<Transaction name="Transaction1">
<Segment name="Segment11">
<BillingTotal>100</BillingTotal>
</Segment>
<Segment name="Segment12">
<BillingTotal>200</BillingTotal>
</Segment>
</Transaction>

Output - OnTransactionFailure

<MsgGuid> 9B5AA155-4F7B-46AC-9A92-A253BE14C6B7</MsgGuid>
<EffectiveDate> 2016-11-01</EffectiveDate>
<ActivityDateTime>2018-07-18T09:32:12.643-05:00 <ActivityDateTime>
<ActivityGuid> AB4016A2-573D-4918-A94D-1F786725B717 </ActivityGuid>
<ActivityStatus>Pending</ActivityStatus>

Example of a JSTL Template

<Message>
<Parameters>
      <Parameter name=Eventname>Activity: Event </Parameter>
      <Parameter name=MsgGuid > Activity:MSgguid </Parameter>
      <Parameter name=EffectiveDate> Activity:EffDate </Parameter>
      <Parameter name=PolicyNumber> Activity:PolNumber </Parameter>
      <Parameter name=PaidToDate> Activity:PaidToDate </Parameter>
      <Parameter name=ModalPremium> Activity:ModalPremium </Parameter>
      <Parameter name=EFTModalPremium> Activity: EFTModalPremium </Parameter>
      <Parameter name=AnnualDiscount> Activity: AnnualDiscount </Parameter>
</Parameters>
<JSTLMessage>
       <Event EVENTNAME=[EventName]></Event>
       <MsgGUID>[MesgGuid] </MsgGUID>                   
       <EffectiveDate> [EffectiveDate]</EffectiveDate>
              <PolicyNumber>[PolicyNumber]</PolicyNumber
              <PaidToDate>[PaidToDate]</PaidToDate>
              <Premium>
                   <ModalPremium>[ModalPremium]</ModalPremium>
                   <EFTModalPremium>[EFTModalPremium]</EFTModalPremium>
                   <AnnualDiscount>[AnnualDiscount]</AnnualDiscount>
               </Premium>
 </JSTLMessage>
</Message>

Output

<Message>
     <Event EVENTNAME="Billing">
     <MsgGUID> 9B5AA155-4F7B-46AC-9A92-A253BE14C6B7</MsgGUID>                   
     <EffectiveDate> 2016-11-01</EffectiveDate>
             <PolicyNumber>A000075449 </PolicyNumber>
             <PaidToDate>2017-11-01 </PaidToDate>
             <Premium>
                   <ModalPremium>380 </ModalPremium>
                   <EFTModalPremium>400 </EFTModalPremium>
                   <AnnualDiscount> 20 </AnnualDiscount>
              </Premium>
       </Event>
  </Message>